package edu.wust;

import java.io.*;

public class exam58 {
    public static boolean isPrime(int n){
        if(n<2)
            return false;
        if(n==2)
            return true;
        int t=(int)Math.sqrt(n);
        for(int i=2;i<=t;i++){
            if(n%i==0)
                return false;
        }
        return true;
    }
    public static void main(String[] args) throws IOException {
        int start=1;
        int count=0,change=1,truecount=0,primecount=0;
        for(int i=1;i<Integer.MAX_VALUE;i+=2){
            for(int j=0;j<4;j++){
            start+=change;
            count++;
            truecount++;
            if(count==2){
                change++;
                count=0;
            }
            if(truecount%4!=1&&isPrime(start)){
                primecount++;
            }
            }
            double x=primecount,y=2*i-1;
            if(x/y<0.1){
                System.out.println(i);
                break;
            }
        }
    }
}


